package com.leigang.swagger.untils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: yaner-boot
 * @description: 时间戳函数
 * @author: leigang
 * @create: 2019-10-21 23:44
 */
public class DateUntils {

    public static String generateDateline(){
        return Long.toString(System.currentTimeMillis());
    }

    public static String stampToDate(String s) {
        String res;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long lt = new Long(s);
        Date date = new Date(lt);
        res = simpleDateFormat.format(date);
        return res;
    }
}
